package com

import com.obra.Obra;

import grails.test.*

class EnderecoDaObraControllerTests extends ControllerUnitTestCase {
    protected void setUp() {
        super.setUp()
    }

    protected void tearDown() {
        super.tearDown()
    }

    void testRedrect() {
		controller.searchEndereco()
		assertEquals "buscaEndereco", redirectArgs.action
		assertEquals "enderecoDaObra", redirectArgs.controller
    }
	
	void testRender(){
		mockParams.cep = "87040-ABC" 
		controller.searchEndereco()
		assertEquals mockResponse.contentAsString, "CPF Invalido"
		//assertTrue(mockParams.cep, true)	
	}
	
	void testModel(){
		mockParams.cep = "87040-540"
		def model = controller.searchEndereco()
		assertEquals model.resposta, "Endereco da Obra X"
	}
}
